import 'package:flutter/material.dart';

class NoEnablePage extends StatefulWidget {
  const NoEnablePage({Key? key}) : super(key: key);

  @override
  _NoEnablePageState createState() => _NoEnablePageState();
}

class _NoEnablePageState extends State<NoEnablePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          centerTitle: true,
          title: Text(widget.runtimeType.toString()),
        ),
        body: Padding(
          padding: const EdgeInsets.all(8.0),
          child: ListView(
            children: [
              AbsorbPointer(
                child: ElevatedButton(
                  onPressed: () {},
                  child: const Text("禁用点击"),
                ),
              ),
              ElevatedButton(
                onPressed: () {},
                child: const Text("正常点击"),
              ),
              const AbsorbPointer(
                child: TextField(
                  decoration: InputDecoration.collapsed(
                    border: UnderlineInputBorder(),
                    hintText: "禁用输入",
                  ),
                ),
              ),
              TextField(
                textAlign: TextAlign.center,
                textAlignVertical: TextAlignVertical.bottom,
                autofocus: false,
                focusNode: FocusNode(),
                style: const TextStyle(fontSize: 24),
                keyboardType: TextInputType.emailAddress,
                controller: TextEditingController(),
                cursorColor: Colors.green,
                textInputAction: TextInputAction.go,
                textDirection: TextDirection.rtl,
                // decoration: InputDecoration.collapsed(border: OutlineInputBorder(),
                decoration: const InputDecoration.collapsed(
                  border: UnderlineInputBorder(),

                  hintTextDirection: TextDirection.rtl,
                  hintText: "正常输入",
                  // hintStyle:
                  //     TextStyle(fontSize: 24, color: Colors.black26)
                ),
              ),
              const TextField(),
              IgnorePointer(
                  child: ElevatedButton(
                onPressed: () {},
                child: const Text("IgnorePointer禁用点击"),
              )),
            ],
          ),
        ));
  }
}
